package org.ttjhome.db.dbo;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;


@Entity
@Table(name="Activities")
public class Activity implements Serializable{

	
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column
    private Long id;
	
	@Version
	private int version;
	

	@ManyToOne()
	@JoinColumn(nullable=false)
	private Candidate candidate;
	
	@ManyToOne()
	@JoinColumn(nullable=false)
	private Job job;
	
	private String status;
	
	

	@OneToMany(mappedBy="activity",cascade = {CascadeType.ALL},fetch = FetchType.EAGER)
	private Set<ActivityRecord> records = new HashSet<ActivityRecord>();



	public Long getId() {
		return id;
	}



	public void setId(Long id) {
		this.id = id;
	}



	public int getVersion() {
		return version;
	}



	public void setVersion(int version) {
		this.version = version;
	}



	public Candidate getCandidate() {
		return candidate;
	}



	public void setCandidate(Candidate candidate) {
		this.candidate = candidate;
	}



	public Job getJob() {
		return job;
	}



	public void setJob(Job job) {
		this.job = job;
	}



	public String getStatus() {
		return status;
	}



	public void setStatus(String status) {
		this.status = status;
	}



	public Set<ActivityRecord> getRecords() {
		return records;
	}



	public void setRecords(Set<ActivityRecord> records) {
		this.records = records;
	}
	
	
	
}
